package com.lnsf.bookstore.common.enums;

public enum BorrowStatus {
    DAIJIEYUE(4,"待借阅"),
    JIEYUEZHONG(0,"借阅中"),
    DAIGUIHUAN(1,"待归还"),
    YIGUIHUAN(2,"已归还"),
    YUQI(3,"逾期");


    private int value;
    private String text;

    private BorrowStatus(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public static BorrowStatus valueOf(int statusCode) {
        for (BorrowStatus status : values()) {
            if (status.value == statusCode) {
                return status;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
    }

    public int toValue(){
        return value;
    }

    public String toText() {
        return text;
    }


    @Override
    public String toString() {
        return Integer.toString(value);
    }
}
